package com.ssm.collection.admin.base;

import lombok.Getter;
import lombok.Setter;

public @Setter
@Getter
class JsonResult {
	//数字  表示状态
	private Integer code;
	//字符串  表示状态
	private String status;
	private String message;
	private Object data;

	public JsonResult() {
	}

	public void setSuccess(boolean isSuccess) {
		if (isSuccess) {
			code = 1;
			status = "success";
		} else {
			code = 0;
			status = "error";
		}
	}

	JsonResult(boolean isSuccess, String message, Object data) {
		setSuccess(isSuccess);
		this.message = message;
		this.data = data;
	}

	public JsonResult(boolean isSuccess, String message) {
		setSuccess(isSuccess);
		this.message = message;
	}
}
